package com.creative.accountsdk.net.account;

import com.creative.accountsdk.net.Protocol;
import com.creative.accountsdk.net.XParams;
import com.creative.util.EncodeUtil;
import com.loopj.android.http.RequestParams;

import org.json.JSONObject;

/**
 * 合并通行证账号
 * Created by yinjialiang on 15-6-23.
 */
public class MergeProtocol extends Protocol{
    private String loginName;
    private String password;

    public JSONObject jsonUser;

    public MergeProtocol(String loginName, String password)
    {
        this.loginName = loginName;
        this.password = password;
    }

    @Override
    public RequestParams getParams() {
        return new XParams().put("loginname", loginName)
                .put("pwd", EncodeUtil.encryptByBase64(password))
                .getParams();
    }

    @Override
    public String getUrl() {
        return getUrlPrefix()+"acct/merge";
    }

    @Override
    protected void parseReturnMap(JSONObject returnMap) {
        this.jsonUser = returnMap;
    }
}
